blob: bf184c0e2cc6d03f2d416c61b8dfa195f1f8775a (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
|
import BasicLayout from '@/core/components/layouts/BasicLayout'
import IsAuth from '@/lib/auth/components/IsAuth'
import FinishCheckoutComponent from '@/lib/checkout/components/FinishCheckout'
import { useRouter } from 'next/router'
import axios from 'axios'
export async function getServerSideProps(context) {
const { order_id } = context.query
await axios.post(
`${process.env.NEXT_PUBLIC_SELF_HOST}/api/shop/finish-checkout?orderName=${order_id}`,
{},
{ headers: context.req.headers }
)
return { props: {} }
}
export default function Finish() {
const router = useRouter()
return (
<IsAuth>
<BasicLayout>
<FinishCheckoutComponent query={router.query || {}} />
</BasicLayout>
</IsAuth>
)
}
|